package com.hnas.ecard.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.hnas.core.dto.DTOPagedList;
import com.hnas.ecard.dao.ECardChannelInfoDao;
import com.hnas.ecard.mapper.ECardChannelInfoMapper;
import com.hnas.ecard.orm.ECardChannelInfo;
import com.hnas.ecard.service.ECardChannelInfoService;
import com.hnas.ecard.service.dto.DTOECardChannelInfo;
import com.hnas.ecard.service.search.DTOECardChannelInfoSearch;

@Component("eCardChannelInfoService")
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
public class ECardChannelInfoServiceImpl implements ECardChannelInfoService{

	@Autowired
	private ECardChannelInfoDao eCardChannelInfoDao;
	
	@Override
	public ECardChannelInfo saveOrUpdate(DTOECardChannelInfo dto) {
		return this.eCardChannelInfoDao.saveOrUpdate(dto);
	}

	@Override
	public DTOPagedList<DTOECardChannelInfo> page(DTOECardChannelInfoSearch criteria) {
		return this.eCardChannelInfoDao.page(criteria);
	}

	@Override
	public DTOECardChannelInfo findById(String id) {
		return this.eCardChannelInfoDao.findById(id);
	}

	@Override
	public int batchInsert(List<ECardChannelInfo> list) throws Exception{
		return this.eCardChannelInfoDao.batchInsert(list);
	}

}
